<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="<s:url value='/resources/css/control.style.css'/>" />
<link rel="stylesheet" type="text/css" href="<s:url value='/resources/css/control.theme.css'/>" />
<script src="<s:url value='/resources/js/jquery/jquery-1.5.2.min.js'/>" type="text/javascript"></script>
<script src="<s:url value='/resources/js/car/control.datagrid.js'/>" type="text/javascript"></script>
<script src="<s:url value='/tool/My97DatePicker/WdatePicker.js'/>" type="text/javascript" ></script>
<script type="text/javascript">
var contextpath = "<%= request.getContextPath() %>";//上下文

$(function(){
	
	var searchClick = false;
	$('#dataGrid').DataGrid({
		url: '<s:url value="/control/findComplaints.do"/>',
		pageSize: 10,
		columns:[
			{field:'id',title:'序号',width:150,align:'center'},
			{field:'tourCode',title:'电子行程编号',width:150,align:'center'},
			{field:'tourName',title:'行程名称',width:150},
			{field:'travelName',title:'旅行社名称',width:200,align:'center'},
			{field:'userName',title:'投诉人',width:200,align:'center'},
			{field:'phone',title:'联系电话',width:200,align:'center'},
			{field:'time',title:'投诉日期',width:200,align:'center'},
			{field:'action',title:'查看详细',width:200,align:'center',formatter:function(value,row){
				return '<a href="'+contextpath+'/control/complaintDetail.do?plaint.id='+row.id+'">详细</a>';
			}}
		],
		onBeforeLoad: function(param){
			if(searchClick){
				var tourcode = $('#tourcode').val();
				var startTime = $('#startTime').val();
				var endTime = $('#endTime').val();
				if(tourcode!= "")param['plaint.tourCode'] = tourcode;
				if(startTime!= "")param['start'] = startTime;
				if(endTime!= "")param['end'] = endTime;
			}
		},
		onLoadSuccess: function(total,rows){
			if(parent.reSetHeight){
				parent.reSetHeight(rows.length*30);
			}
		}
	});
	
	$('#btnSearch').bind('click',function(){
		searchClick = true;
		$('#dataGrid').DataGrid('reload');
	});
});
</script>
<title>游客投诉查询</title>
</head>
<body>
	<div id="box">
		<h3>游客投诉查询</h3>
		<table>
			<tr>
				<td>行程单号：<input id="tourcode" type="text" value="" style="width: 150px;" />
					&nbsp;&nbsp; 
					投诉时间区间：<input id="startTime" class="WdateFmtErr" onClick="WdatePicker()" type="text" value="" style="width: 120px;" />
					&nbsp;到&nbsp; <input id="endTime" name="endTime" class="WdateFmtErr" onClick="WdatePicker()" type="text" value="" style="width: 120px;" />
					<input type="submit" id="btnSearch" value="搜索" id="btnSearch"/></td>
			</tr>
		</table>
		<div id="dataGrid"></div>
	</div>
</body>
</html>